package com.example.yuejian.activity;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.Toast;

import com.example.yuejian.Bean.Success;
import com.example.yuejian.R;
import com.example.yuejian.listener.ClubListener;
import com.example.yuejian.model.AlterUserInfo;


public class UserInfo extends AppCompatActivity implements ClubListener<Success> {
 private Button commit;
    private ImageView back;
    private EditText edt1,edt2;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_user_info);
        edt1 = (EditText)findViewById(R.id.name);
        edt2 = (EditText)findViewById(R.id.password);
        back = (ImageView)findViewById(R.id.back);
        back.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                finish();
            }
        });
        commit = (Button)findViewById(R.id.commit);
        commit.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                String name = edt1.getText().toString();
                AlterUserInfo alterUserInfo = new AlterUserInfo();
                alterUserInfo.alterUserData(UserInfo.this,12395,name,"11");
            }
        });
    }

    @Override
    public void onResponse(Success success) {
        Toast.makeText(this,"修改成功",Toast.LENGTH_LONG).show();
    }

    @Override
    public void onFail(String msg) {
        Toast.makeText(this,"链接服务器超时",Toast.LENGTH_LONG).show();
    }
}
